package colopllet.colopl.service;

import java.util.List;

import colopllet.colopl.pc.ColoplPCLoginException;
import colopllet.colopl.pc.ColoplPCRequestException;
import colopllet.colopl.pc.request.MyWarehouseRequest;
import colopllet.colopl.pc.response.MyWarehouseResponse;
import colopllet.colopl.pc.session.ColoplSession;

public class BaseService {

    protected List<MyWarehouseResponse> getAllWarehouseResponse(
            ColoplSession session) throws ColoplPCLoginException,
            ColoplPCRequestException {
        
        List<MyWarehouseResponse> list = null;
        MyWarehouseRequest req = new MyWarehouseRequest(session, 0);
        MyWarehouseResponse res = req.execute();
        int size = res.getPageCount();
        for (int i = 1; i < size; i++) {
            MyWarehouseRequest req2 = new MyWarehouseRequest(session, i);
            MyWarehouseResponse res2 = req2.execute();
            list.add(res2);
        }
        return list;
    }
}
